package work20241210.a_String;

/**
 * @author zdl
 * @date 2024/12/10
 */
public class StringContains {
    public static void main(String[] args) {
        String a = "java";
        String b = "ava";
        System.out.println(a.contains(b));
        char[] charArray = a.toCharArray();
        for (int i = charArray.length -1; i > 0; i--) {
            if ('a' == charArray[i] && 'v' == charArray[i-1] && 'a' == charArray[i-1-1]){
                System.out.println("存在");
                break;
            }else {
                System.out.println("不存在");
                break;
            }
        }
    }

}
